<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/ugs/tenantUgsSuperLevelPrice.js"></script>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return '<br>' +
            '<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>会员管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>编辑用户等级</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <div class="columns pull-left">
                        <h5 class="font-bold">编辑用户等级</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <form class="form-horizontal m-t layui-form" id="frmTenantUgsSuperLevelPrice">
                        <input name="superLevelPriceId" id="superLevelPriceId"
                               value="${tenantUgsSuperLevelPrice.superLevelPriceId}"
                               type="hidden">
                        <input name="superLevelType" id="superLevelType"
                               value="${tenantUgsSuperLevelPrice.superLevelType}"
                               type="hidden">
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">超级会员类型：</label>
                            <div class="col-sm-4">
                                <select class="form-control" DISABLED>
                                    <option value="0"
                                            <c:if test="${tenantUgsSuperLevelPrice.superCardType eq '0'}">selected</c:if>   >
                                        月卡
                                    </option>
                                    <option value="1"
                                            <c:if test="${tenantUgsSuperLevelPrice.superCardType eq '1'}">selected</c:if>   >
                                        季卡
                                    </option>
                                    <option value="2"
                                            <c:if test="${tenantUgsSuperLevelPrice.superCardType eq '2'}">selected</c:if>   >
                                        年卡
                                    </option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">背景图：</label>
                            <div class="col-sm-4">
                                <div id="">
                                    <c:choose>
                                        <c:when test="${tenantUgsSuperLevelPrice.superCardImg!=null && tenantUgsSuperLevelPrice.superCardImg!=''}">
                                            <div id="">
                                                <img id="superCardImg"
                                                     src="${uploadPath}${tenantUgsSuperLevelPrice.superCardImg}"
                                                     width="155px" height="120px">
                                                <input type="file" id="file" name="file"/>
                                            </div>
                                        </c:when>
                                        <c:otherwise>
                                            <div id="">
                                                <img id="superCardImg" src="${ctx}/statics/img/upload-img.png"
                                                     style="position: relative" width="155px" height="120px">
                                                <input type="file" id="file" name="file"/>
                                            </div>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                                <span>图片尺寸建议为：<span class="text-danger">98px*75px</span></span>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">价格：</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" id="superLevelPrice" name="superLevelPrice"
                                       value="${tenantUgsSuperLevelPrice.superLevelPrice}">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">特权说明：</label>
                            <div class="col-sm-4">
                                <textarea type="text" class="form-control" id="remark" name="remark"
                                          >${tenantUgsSuperLevelPrice.remark}</textarea>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">购买及续费说明：</label>
                            <div class="col-sm-4">
                                <textarea  class="form-control" name="remark2" id="remark2"
                                          >${tenantUgsSuperLevelPrice.remark2}</textarea>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">状态：</label>
                            <div class="col-sm-4">
                                <select class="form-control" name="status" id="status">
                                    <option value="0"
                                            <c:if test="${tenantUgsSuperLevelPrice.status eq '0'}">selected</c:if>  >正常
                                    </option>
                                    <option value="1"
                                            <c:if test="${tenantUgsSuperLevelPrice.status eq '1'}">selected</c:if>  >停用
                                    </option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-3 col-sm-offset-8 text-right">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">

    $("#file").change(function () {
        var objUrl = getObjectURL(this.files[0]);//获取文件信息
        if (objUrl) {
            $("#superCardImg").attr("src", objUrl);
        }
    });

    function getObjectURL(file) {
        var url = null;
        if (window.createObjectURL != undefined) {
            url = window.createObjectURL(file);
        } else if (window.URL != undefined) { // mozilla(firefox)
            url = window.URL.createObjectURL(file);
        } else if (window.webkitURL != undefined) { // webkit or chrome
            url = window.webkitURL.createObjectURL(file);
        }
        return url;
    }


    layui.use(['form', 'jquery', 'tree', 'laydate', 'util'], function () {

        var form = layui.form;
        var $ = layui.jquery;

    })


    editTenantUgsSuperLevelPrice.init();
</script>
</body>
</html>
